
var app = getApp()
Page({
  data: {
    name:'',
    phone:'',
    imgs:[],
    remarks:''
  },
  onLoad: function (options) {
    this.getVoucher(options.orderId)
  },
  getVoucher(orderId){
    let that = this
    let data = {
      orderId
    }
    app.request('wx_app/user_order/getVoucher',data,'GET').then(res=>{
      console.log(res)
      if (res.code==1) {
        let imgs = []
        imgs.push(res.data.pic1,res.data.pic2,res.data.pic3,res.data.pic4,res.data.pic5)
        that.setData({
          name:res.data.buyerName,
          phone:res.data.buyerPhone,
          imgs,
          remarks:res.data.remarks
        })
      }else{
        app.errorMsg(res.message)
      }
    })
  }
})
